package myException.myRestfulGolbalException;


/**
 * 自定义异常
 */
public abstract class EnergyException extends RuntimeException {

    private long code;
    private String msg;

    public EnergyException(ResultMsg error) {
        super(error.message());
        this.code = error.code();
        this.msg = error.message();
    }

    public EnergyException(ResultMsg error, String msg) {
        super(error.message());
        this.code = error.code();
        this.msg = error.message() + " " + msg;
    }

//    public EnergyException(long code, String msg) {
//        super(msg);
//        this.code = code;
//        this.msg = msg;
//    }

    public long getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }
}